<template>
	<view class="project-container">
		<view class="list">
			<view v-for="(item,index) in list" :key="index" class="list-item" @click="goPage(item.link)">
				<view class="img-cover">
					<image :src="item.envelopePic"></image>
				</view>
				<view class="content-right">
					<view class="title">{{item.title}}</view>
					<view class="desc">{{item.desc}}</view>
					<view class="desc-date">
						<view>{{item.author}}</view>
						<view class="date-txt">{{item.niceDate}}</view>
					</view>
					<view class="bottom-desc" @click.stop="doLove(index,item.id)">
						
						
							<image class="icon-collect" :src="item.collect==true?'https://www.wanandroid.com/resources/image/pc/collect_icon_hover.svg':'https://www.wanandroid.com/resources/image/pc/collect_icon.svg'"></image>
						
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"projet-list",
		props:{
			list:{
				type:Array,
				default:()=>[]
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			goPage(link=''){
				uni.navigateTo({
					url:"/pages/webPage/webPage?url="+encodeURIComponent(link)
				})
				
			},
			doLove(index,id){
				this.$emit('loves',index,id)
			}
		}
	}
</script>

<style lang="scss" scoped>
	
.project-container{
	padding: 32rpx;
	.list{
		.list-item{
			display: flex;
			margin-bottom: 16rpx;
			align-items: center;
			border-bottom: 1px solid green;
			position: relative;
			.content-right{
				.bottom-desc{
					
					margin-bottom: 12rpx;
					margin-top: 12rpx;
					text-align: right;
					.icon-collect{
						width: 40rpx;
						height: 40rpx;
					}
				}
				.desc-date{
					display: flex;
					margin-top: 60rpx;
					.date-txt{
						margin-left: auto;
					}
				}
				.title{
					font-size: 32rpx;
					font-weight: 500;
				}
				.desc{
					margin: 12rpx 0;
				}
			}
			.img-cover{
				
				
				height: 300rpx;
				>image{
					width: 150rpx;
					margin-right: 16rpx;
					
					height: 300rpx;
					margin-bottom: 16rpx;
				}
			}
		}
	}
}
</style>